package com.google.code.jmarias.common;

import com.google.code.jmarias.common.action.AbstractSignedMessage;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * 
 *
 * Tvurcem teto zpravy je vzdy server.
 * @author Ondrej Michal
 */
@XmlRootElement
public class Token extends AbstractSignedMessage {

    private AbstractUser playingNow;

    private List<Class> allowedActions;


    public Token() {
    }

    public Token(AbstractUser playingNow) {
        this.playingNow = playingNow;
    }

    @Override
    public String toString() {
        String info = "";
        if (getAllowedActions() != null) {
            info = ", povolene akce: " + getAllowedActions().toString();
        }
        return "Na tahu je " + playingNow + info;
    }

    public List<Class> getAllowedActions() {
        return allowedActions;
    }

    public void setAllowedActions(List<Class> availableActions) {
        this.allowedActions = availableActions;
    }

    public AbstractUser getPlayingNow() {
        return playingNow;
    }

    public void setPlayingNow(AbstractUser playingNow) {
        this.playingNow = playingNow;
    }

}
